package dsk.demo.product.controller.automarket;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import dsk.demo.common.utils.R;
import dsk.demo.product.dao.HangyeDao;
import dsk.demo.product.entity.Hangye;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("hangye")
public class HangyeController {

    @Autowired
    private HangyeDao hangyeDao;

    @GetMapping("/list")
    public R list(){
        List<Hangye> hangyes = hangyeDao.selectList(new QueryWrapper<>());
        return R.ok().put("data",hangyes);
    }
}
